import fetch from "./index";

export const fetchGet = <T>(url: string, params?: unknown): Promise<T> =>
  fetch(url, {
    method: "get",
    params: params,
  });

export const fetchPost = <T>(url: string, params?: unknown): Promise<T> =>
  fetch(url, {
    method: "post",
    data: params,
  });
  export const fetchPut = <T>(url: string, params?: unknown): Promise<T> =>
  fetch(url, {
    method: "put",
    data: params,
  });
export const fetchPostForm = <T>(url: string, params?: unknown): Promise<T> =>
  fetch(url, {
    method: "post",
    data: params,
    headers: {
      "Content-Type": "multipart/form-data",
    },
  });
